
var mySwiper = new Swiper('.swiper', {
    loop: true, // 循环模式选项
    autoplay: true,
    // 如果需要分页器
    pagination: {
        el: '.swiper-pagination',
        clickable: true,
    },

    // 如果需要前进后退按钮
    navigation: {
        nextEl: '.swiper-button-next',
        prevEl: '.swiper-button-prev',
    },
})


let li = document.querySelectorAll('.api li')

li.forEach(function (v, i) {
    v.addEventListener('mouseover', function () {
        v.style.backgroundColor = '#1271ef'
        v.querySelector('img').src = '../imgs/api0' + (i + 1) + '-c' + '.svg'
        v.querySelector('p').style.color = '#fff'
    })
    v.addEventListener('mouseout', function () {
        v.style.backgroundColor = '#fff'
        v.querySelector('img').src = '../imgs/api0' + (i + 1) + '.svg'
        v.querySelector('p').style.color = '#000'
    })
})
let stop = document.querySelector('.stop')
window.addEventListener('scroll', function () {
    sTop = document.documentElement.scrollTop
    if (sTop >= 800) {
        stop.style.display = 'block'
    } else {
        stop.style.display = 'none'
    }
})
stop.addEventListener('click', function () {
    window.scrollTo({
        top: 0,
        behavior: "smooth"   //丝滑的回到顶部
    })
})



let hcfcTable = document.querySelectorAll('.hcfc-table')
let index = 0
let time = setInterval(function () {
    hcfcTable[index].classList.remove('aup')
    ++index
    if (index == hcfcTable.length) index = 0;
    hcfcTable[index].classList.add('aup')
}, 2000)
let hcfcSub = document.querySelector('.hcfc-sub')
hcfcSub.addEventListener('mouseover', function () {
    clearInterval(time)
})
hcfcSub.addEventListener('mouseout', function () {
    time = setInterval(function () {
        hcfcTable[index].classList.remove('aup')
        ++index
        if (index == hcfcTable.length) index = 0;
        hcfcTable[index].classList.add('aup')
    }, 2000)
})